﻿namespace RestaurantMenu.Library
{
    public class Customer
    {
        private readonly ProductList order;

        public ProductList Order
        {
            get
            {
                return this.order;
            }
        }

        public decimal CalculateTotalPrice()
        {
            decimal totalPrice = 0;
            foreach (var product in order.AllProducts)
            {
                totalPrice += product.Product.Price;
            }
            return totalPrice;
        }

        public NutritionFacts TotalNutritionFacts()
        {
            NutritionFacts totalNutrition = new NutritionFacts();

            foreach (var product in order.AllProducts)
            {
                totalNutrition += product.Product.Nutrition;
            }
            return totalNutrition;
        }

        public int TotapCalories()
        {
            return TotalNutritionFacts().Calories;
        }

        public Customer()
        {
            order = new ProductList();
        }
    }
}
